Closer/firestore-tests/jest.globalSetup.ts

8 lines
346 B
TypeScript

// Runs once before the full test suite.
// The Firestore emulator must already be running on port 8180 before running tests.
// Start it with: firebase emulators:start --only firestore
export default async function () {
const port = process.env.FIRESTORE_EMULATOR_PORT ?? "8180";
process.env.FIRESTORE_EMULATOR_HOST = `127.0.0.1:${port}`;
}