bmrc-testing

Runs and extends Firestore emulator test suites for the BMRC logistics application.

2|Updated Dec 24, 2025
One-click install
npx skills add https://github.com/iv-zhang/BMRC-Logistics --skill bmrc-testing-iv-zhang
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: bmrc-testing
Source: https://github.com/iv-zhang/BMRC-Logistics/tree/main/.claude/skills/bmrc-testing
Command: npx skills add https://github.com/iv-zhang/BMRC-Logistics --skill bmrc-testing-iv-zhang

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Verifying changes to a Firebase-backed logistics app is risky without a safe, repeatable test environment. This Skill explains how to run the BMRC test tiers against the Firestore emulator, add new invariant tests, and verify changes end-to-end without ever touching production data. ## Core Features & Use Cases - Tiered test commands: Choose the right suite for each change, from offline pure-logic tests to invariant integration suites, fast-check property tests, a 15-week semester simulation, and Playwright e2e tests. - Emulator safety guard: A hard guard refuses production-shaped config (non-demo projects, real credentials, missing emulator host), so tests can never touch live Firestore data. - Invariant test recipe: A step-by-step pattern for adding new invariant tests (e.g. INV-13) that drive the real app/lib helpers through the real Firestore client and assert on resulting documents. - Use Case: After changing the receiving logic, run npm run test:invariants and npm run test:simulation against the emulator, then drive a full checkout-to-check-in flow in the dev server to confirm dashboards and logs update correctly. ## Quick Start Ask the assistant to run the BMRC invariant test suites against the Firestore emulator and report which tiers pass before shipping your change.

Frequently Asked Questions about bmrc-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Firebase Firestore emulator tests for a Next.js app?▼

Run npm run test:emulator, which seeds the fixture world and executes the invariant, property, and simulation suites via firebase emulators:exec with the demo-bmrc-logistics project. Firestore runs on 127.0.0.1:8080 and the emulator UI on port 4000.

How do I add a new invariant test to an emulator test suite?▼

Create a file like scripts/emulator/invariants/inv-13.test.ts that imports the harness, calls defineInvariant with the rule statement, and drives the real app/lib helpers. Then register it in run-invariants.ts and run npm run test:invariants.

Why does the Firestore emulator guard abort my test run?▼

The guard hard-exits when it detects production-shaped config: a missing emulator host, a non demo-* project id, or real credentials. The abort means your environment variables are wrong, not the guard; fix the env so tests only target the emulator.

Can I test Firebase logic against production data instead of the emulator?▼

No. The harness explicitly refuses production-shaped configuration, and tests must never run against live data. All suites use the demo-bmrc-logistics project with freshly seeded fixtures so every suite is isolated and order-independent.

What is the difference between property tests and invariant tests with fast-check?▼

Invariant tests (INV-1 through INV-12) are integration suites that drive real app/lib helpers against the emulator and assert on Firestore documents. Property tests use fast-check with an oracle Ledger model to check real-code conformance of computeBagStock and getItemStatus math.