masumomo / firebase-functions-test-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

firebase-functions-test-sample

Setup note https://firebase.google.com/docs/functions/get-started

firebase login
firebase init firestore

=== Project Setup
...
? Please select an option: Create a new project
i  If you want to create a project in a Google Cloud organization or folder, please use "firebase projects:create" instead, and return to this command when you've created the project.
? Please specify a unique project id (warning: cannot be modified afterward) [6-30 characters]:
 miki-firebase-test-sample
? What would you like to call your project? (defaults to your project ID) 
βœ” Creating Google Cloud Platform project
βœ” Adding Firebase resources to Google Cloud Platform project

πŸŽ‰πŸŽ‰πŸŽ‰ Your Firebase project is ready! πŸŽ‰πŸŽ‰πŸŽ‰

Project information:
   - Project ID: miki-firebase-test-sample
   - Project Name: miki-firebase-test-sample
firebase init functions


     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  /Users/miki/repo/firebase-functions-test-sample


=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

? Please select an option: Use an existing project
? Select a default Firebase project for this directory: miki-firebase-test-sample (miki-firebase-test-sample)
i  Using project miki-firebase-test-sample (miki-firebase-test-sample)

=== Functions Setup

A functions directory will be created in your project with a Node.js
package pre-configured. Functions can be deployed with firebase deploy.

? What language would you like to use to write Cloud Functions? JavaScript
? Do you want to use ESLint to catch probable bugs and enforce style? Yes
βœ”  Wrote functions/package.json
βœ”  Wrote functions/.eslintrc.js
βœ”  Wrote functions/index.js
βœ”  Wrote functions/.gitignore
? Do you want to install dependencies with npm now? Yes
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: undefined,
npm WARN EBADENGINE   required: { node: '12' },
npm WARN EBADENGINE   current: { node: 'v16.0.0', npm: '7.10.0' }
npm WARN EBADENGINE }

added 321 packages, and audited 322 packages in 17s

25 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

i  Writing configuration info to firebase.json...
i  Writing project information to .firebaserc...

βœ”  Firebase initialization complete!

Set up emulator

https://firebase.google.com/docs/functions/local-emulator

firebase init emulators

=== Emulators Setup ? Which Firebase emulators do you want to set up? Press Space to select emulators, then Enter to confirm your choices. Authentication Emulator, Functions Emulator, Firestore Emulator ? Which port do you want to use for the auth emulator? 9099 ? Which port do you want to use for the functions emulator? 5001 ? Which port do you want to use for the firestore emulator? 8080 ? Would you like to enable the Emulator UI? Yes ? Which port do you want to use for the Emulator UI (leave empty to use any available port)? ? Would you like to download the emulators now? Yes

i Writing configuration info to firebase.json... i Writing project information to .firebaserc...

βœ” Firebase initialization complete!

firebase emulators:start

install dependency

npm install --save-dev firebase-functions-test
npm install --save-dev jest

About


Languages

Language:JavaScript 100.0%