{"id":13996023,"url":"https://github.com/firebase/firebase-functions-test","last_synced_at":"2025-05-14T19:02:23.276Z","repository":{"id":37502848,"uuid":"127173059","full_name":"firebase/firebase-functions-test","owner":"firebase","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-10T23:07:31.000Z","size":1248,"stargazers_count":238,"open_issues_count":61,"forks_count":57,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-04-06T09:03:25.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firebase.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-28T17:09:23.000Z","updated_at":"2025-03-15T18:56:07.000Z","dependencies_parsed_at":"2023-02-08T07:15:21.807Z","dependency_job_id":"cdaf7d65-9bbd-4d4f-92be-c0974dc015ea","html_url":"https://github.com/firebase/firebase-functions-test","commit_stats":{"total_commits":174,"total_committers":30,"mean_commits":5.8,"dds":0.7931034482758621,"last_synced_commit":"c3c9abc4582231d827b026a75839d5b87b58b943"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-functions-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-functions-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-functions-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firebase%2Ffirebase-functions-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firebase","download_url":"https://codeload.github.com/firebase/firebase-functions-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717240,"owners_count":21150387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T14:03:44.214Z","updated_at":"2025-04-13T12:45:53.662Z","avatar_url":"https://github.com/firebase.png","language":"TypeScript","readme":"# Firebase Test SDK for Cloud Functions\n\nThe `firebase-functions-test` is unit testing library for Cloud Functions for Firebase. It is a companion to [firebase-functions](https://github.com/Firebase/firebase-functions).\n\n_NOTE: This library can only be used with `firebase-functions` v3.20.1 or above._\n\n## Usage\n\n1. Write some Firebase Functions\n2. With your testing framework of choice, write a unit-test that imports your Firebase Functions.\n3. `wrap` your Firebase Functions. You can invoke the Firebase Function's handler by invoking the `wrap` call.\n\nEg.\n\n```typescript\nimport {myFirebaseFunction} from \"../index\"; // Your Firebase Functions\nimport firebaseFunctionsTest from \"firebase-functions-test\";\n\n// Extracting `wrap` out of the lazy-loaded features\nconst {wrap} = firebaseFunctionsTest();\n\n// `jest-ts` example\ntest('my unit test', () =\u003e {\n  const wrappedFirebaseFunction = wrap(myFirebaseFunction);\n\n  // Invoke the firebase function\n  wrappedFirebaseFunction();\n\n  // Invoke the firebase function with CloudEvent overrides\n  wrappedFirebaseFunction({data: {arbitrary: 'values'}});\n});\n```\n\n## Examples\n\n* [Unit Testing Gen-1 Cloud Functions using Mocha](https://github.com/firebase/functions-samples/tree/main/Node-1st-gen/quickstarts/uppercase-rtdb/functions)\n* [Unit Testing Gen-2 Cloud Functions using Mocha](https://github.com/firebase/functions-samples/tree/main/Node/test-functions-mocha/functions)\n* [Unit Testing Gen-2 Cloud Functions using Jest](https://github.com/firebase/functions-samples/tree/main/Node/test-functions-jest/functions)\n* [Unit Testing Gen-2 Cloud Functions using Jest-Ts](https://github.com/firebase/functions-samples/tree/main/Node/test-functions-jest-ts/functions)\n\n## Learn more\n\nLearn more about unit testing Cloud Functions [here](https://firebase.google.com/docs/functions/unit-testing).\n\n## Contributing\n\nTo contribute a change, [check out the contributing guide](.github/CONTRIBUTING.md).\n\n## License\n\n© Google, 2018. Licensed under [The MIT License](LICENSE).\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebase%2Ffirebase-functions-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirebase%2Ffirebase-functions-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirebase%2Ffirebase-functions-test/lists"}