MCPcopy Create free account
hub / github.com/firebase/firebase-functions-test

github.com/firebase/firebase-functions-test @v3.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.5.0 ↗ · + Follow
139 symbols 400 edges 64 files ⚖ MIT 9 documented · 6% 15 cross-repo links updated 18d agov3.5.0 · 2026-05-08★ 24713 open issues

Browse by type

Functions 131 Types & classes 8
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Firebase Test SDK for Cloud Functions

The firebase-functions-test is unit testing library for Cloud Functions for Firebase. It is a companion to firebase-functions.

NOTE: This library can only be used with firebase-functions v3.20.1 or above.

Usage

  1. Write some Firebase Functions
  2. With your testing framework of choice, write a unit-test that imports your Firebase Functions.
  3. wrap your Firebase Functions. You can invoke the Firebase Function's handler by invoking the wrap call.

Eg.

import {myFirebaseFunction} from "../index"; // Your Firebase Functions
import firebaseFunctionsTest from "firebase-functions-test";

// Extracting `wrap` out of the lazy-loaded features
const {wrap} = firebaseFunctionsTest();

// `jest-ts` example
test('my unit test', () => {
  const wrappedFirebaseFunction = wrap(myFirebaseFunction);

  // Invoke the firebase function
  wrappedFirebaseFunction();

  // Invoke the firebase function with CloudEvent overrides
  wrappedFirebaseFunction({data: {arbitrary: 'values'}});
});

Examples

Learn more

Learn more about unit testing Cloud Functions here.

Contributing

To contribute a change, check out the contributing guide.

License

© Google, 2018. Licensed under The MIT License.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 125
Method 6
Class 4
Interface 4

Languages

TypeScript100%

Modules by API surface

src/v1.ts13 symbols
src/providers/firestore.ts8 symbols
src/cloudevent/mocks/firestore/helpers.ts7 symbols
src/app.ts7 symbols
src/cloudevent/mocks/helpers.ts6 symbols
src/lifecycle.ts5 symbols
src/cloudevent/mocks/database/helpers.ts5 symbols
src/cloudevent/generate.ts4 symbols
src/v2.ts3 symbols
src/providers/database.ts3 symbols
src/cloudevent/mocks/testlab/test-lab-on-test-matrix-completed.ts3 symbols
src/cloudevent/mocks/remoteconfig/remote-config-on-config-updated.ts3 symbols

For agents

$ claude mcp add firebase-functions-test \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page