jest-environment-firebase-functions
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Jest Environment - Firebase Functions

A Jest testing environment for Firebase functions.

Version Downloads Stats

Installation

npm i --save-dev jest-environment-firebase-functions

Usage

Configuring Jest

// jest.config.js
/** @type {import('jest').Config} */
module.exports = {
	preset: 'ts-jest',
	testEnvironment: 'jest-environment-firebase-functions',
	/** @type {import('jest-environment-firebase-functions').Options} */
	testEnvironmentOptions: {
		firebaseMode: 'online',
		projectId: 'my-project',
		storageBucket: 'my-project.appspot.com',
		databaseURL: 'https://my-project.firebaseio.com',
		keyPath: './serviceAccountKey.json'
	}
}

For more on writing tests, see the Firebase documentation.

Options

Option Required Notes
projectId Yes
firebaseMode No "online" or "offline" (default)
keyPath No firebaseMode defaults to "online" when set
storageBucket No
databaseURL No

Package Sidebar

Install

npm i jest-environment-firebase-functions

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.09 kB

Total Files

5

Last publish

Collaborators

  • bkeys818