{"id":38052878,"url":"https://github.com/akauppi/firebase-jest-testing","last_synced_at":"2026-01-18T03:03:25.460Z","repository":{"id":43332077,"uuid":"286191210","full_name":"akauppi/firebase-jest-testing","owner":"akauppi","description":"Firebase back-end testing, using Jest.","archived":false,"fork":false,"pushed_at":"2022-09-26T06:18:58.000Z","size":2551,"stargazers_count":21,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-21T10:42:44.701Z","etag":null,"topics":["cloud-functions","emulation","firestore","jest","testing-firebase"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/akauppi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-08-09T07:46:34.000Z","updated_at":"2022-09-16T11:09:36.000Z","dependencies_parsed_at":"2022-09-14T07:10:18.231Z","dependency_job_id":null,"html_url":"https://github.com/akauppi/firebase-jest-testing","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/akauppi/firebase-jest-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akauppi%2Ffirebase-jest-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akauppi%2Ffirebase-jest-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akauppi%2Ffirebase-jest-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akauppi%2Ffirebase-jest-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akauppi","download_url":"https://codeload.github.com/akauppi/firebase-jest-testing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akauppi%2Ffirebase-jest-testing/sbom","scorecard":{"id":175610,"data":{"date":"2025-08-11","repo":{"name":"github.com/akauppi/firebase-jest-testing","commit":"b7fcf36629a43ba8d1200d00acc2d5c47bbd0c3b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":4,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Warn: no linked content found","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T17:37:57.325Z","repository_id":43332077,"created_at":"2025-08-16T17:37:57.325Z","updated_at":"2025-08-16T17:37:57.325Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cloud-functions","emulation","firestore","jest","testing-firebase"],"created_at":"2026-01-16T20:15:29.834Z","updated_at":"2026-01-18T03:03:25.184Z","avatar_url":"https://github.com/akauppi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firebase-jest-testing\n\nThis `README` is for the developers.\n\nFor using the package, see [package/README.md](package/README.md) (that ships with the package).\n\n---\n\nTools for testing Firebase back-end features, using Jest.\n\nThis repo provides a \"one stop\", opinionated approach to testing Firebase projects. Using it may save you from reading countless pages of documentation and evaluating different testing strategies and libraries.\n\nAlso, the tools handle configuring emulation for you. In all, this tries to give a simpler development experience than the current (Aug 2021) Firebase tooling does.\n\nThe idea is that you don't have to pull in either `firebase-admin` nor `firebase` in your own testing project, but get all the tools through here.\n\n\n## Folder structure\n\nThe package itself is placed under `package`.\n\nThe `sample` folder contains a sample Firebase backend used for testing:\n\n- `sample/functions` has the definitions of the Cloud Functions\n- `sample/firestore.rules` has the Firestore Security Rules\n- `sample/test-fns` contains Cloud Function tests\n- `sample/test-rules` contains Security Rules tests\n\nYou can use this sample as a template for your own Firebase backend testing project.\n\n## Requirements\n\n- node \u003e= 16.5\n- npm \u003e= 7.7.0\n\n\u003c!--\nDeveloped with:\n- macOS 12.5.1\n- node 18.7\n- npm 8.15\n\n+ Docker Desktop for Mac 4.11.1\n  - 3 cores, 2 GB, 512 MB swap\n  - VirtioFS enabled\n--\u003e\n\n## Getting started\n\nFetch dependencies:\n\n```\n$ npm install\n```\n\nNow, you're ready to start the emulation and run tests against it.\n\n\n## Two ways ahead\n\nThere are two ways to run the tests, each with their own pros and cons. We'll call them the \"CI\" (Continuous Integration) and \"dev\" (development) flows, according to their main use cases.\n\nLet's start with the simpler one.\n\n\n### CI: Run all the tests\n\nLaunching the tests is this easy:\n\n```\n$ cd sample\n$ npm install\n...\n```\n\n```\n$ npm test\n...\nTest Suites: 2 passed, 2 total\nTests:       3 passed, 3 total\nSnapshots:   0 total\nTime:        2.547 s, estimated 3 s\n\n...\nTest Suites: 5 passed, 5 total\nTests:       29 passed, 29 total\nSnapshots:   0 total\nTime:        5.389 s\n```\n\nThere are two separate Jest test suites run here, one after the other. One for Cloud Functions and another for Security Rules tests. It is possible to merge these but the author currently thinks it's best to keep them separate.\n\nIn \"CI mode\", each run launches the emulators anew. This takes ~5s that we can spare, by using the \"dev\" mode.\n\n\n### Dev mode\n\nIn dev mode, a server runs continuously on the background so repeated runs of the tests are a bit faster. This same server can be used for both Cloud Functions and Security Rules testing - even in parallel.\n\n```\n$ cd sample  # unless you already are there\n```\n\n**Starting the emulator**\n\nStart the emulator in one terminal, and leave it running:\n\n```\n$ npm run start\n```\n\nOnce we run tests, it's worth checking the emulator output, occasionally.\n\n**Running tests**\n\nIn another terminal:\n\n```\n$ npm run test:fns:greet\n$ npm run test:fns:userInfo\n...\n```\n\nFor testing Security Rules:\n\n```\n$ npm run test:rules:invites\n$ npm run test:rules:projects\n$ npm run test:rules:symbols\n$ npm run test:rules:userInfo\n$ npm run test:rules:visited\n```\n\nSure you get the gist of it. 🤓\n\nThese are prepared for you in `package.json`. When developing something, it's meaningful to run only one suite, at a time.\n\nOnce you think things are rolling fine, run `npm test` to confirm.\n\n\u003eNote: Since both CI and dev use the same emulator ports (defined in `firebase.json`), one cannot launch `npm test` while the emulator is running. Shut it down by Ctrl-C.\n\n\n## Using Docker Compose 🎁\n\nThis is a more advanced (complex) setup, but one you should study for your own projects. It has some advantages:\n\n- no need for multiple terminals. Docker Compose keeps the emulators running and their console output can be observed in the Docker Desktop application.\n- no need for installing `concurrently` or `firebase-tools` npm modules.\n\nSee [`sample.dc/README`](sample.dc/README.md) for details.\n\n\n## CI setup\n\nContinuous Integration uses Docker Compose, to run the same tests.\n\nSee [`ci/README`](ci/README.md) for details.\n\n\n## Other docs\n\n- [Approach](APPROACH.md)\n- [Developer notes](DEVS.md)\n- [Known issues](KNOWN.md)\n- [Tracked issues](TRACK.md)\n\n## References\n\n- [ES modules in Node today](https://blog.logrocket.com/es-modules-in-node-today/) (blog, Mar 2020)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakauppi%2Ffirebase-jest-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakauppi%2Ffirebase-jest-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakauppi%2Ffirebase-jest-testing/lists"}