Skip to content

tja4472/firebase-emulators-codelab

Repository files navigation

The project is based on https://github.com/firebase/emulators-codelab which is used by the following Google codelabs.

  1. Getting started with the Firebase Local Emulator Suite
  2. Test-drive Firestore Security Rules
  3. Test-drive Complex Firebase Functions

Setup

Add the following files:

.firebaserc

{
  "projects": {
    "default": "your real Firebase Project ID"
  }
}

functions/firebase-info.js

const PROJECT_ID = "your real Firebase Project ID";
module.exports = {
  PROJECT_ID,
};

Terminal

npm install
cd functions
npm install

Run

  • Run emulator:start script in package.json
  • Run test - functions script in functions/package.json

Issues

Releases

Testing with Jest

  • Open the jest-tests folder in another instance of vscode. This will allow the use of the vscode-jest extension for working with the tests.
  • Initially Jest will be stopped. View > Command Pallete > Jest: Start Ruuner will start Jest.
  • The emulator needs to be running for the the tests to pass: emulators:start