Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Error when testing against Firebase Emulator 'Expected type 'Pa', but it was: a custom Fa object'

I'm currently attempting to execute the following test in Cypress.

before(async () => {
  testEnv = await initializeTestEnvironment({
    projectId: MY_PROJECT_ID,
    firestore: {
      host: "localhost",
      port: 8080,
    },
  });
});
describe("Authorized user can write to collection", () => {
  it("Can write to firestore doc", async () => {
    console.log("testEnv", testEnv);

    const alice = testEnv.authenticatedContext("alice", { role: "user" });
    console.log("alice", alice);

    const firestore = alice.firestore();
    console.log("firestore", firestore);

    const testA = await assertSucceeds(
      setDoc(alice.firestore(), "/users/alice"),
      {
        foo: "bar",
      }
    );
    console.log("testA", testA);
  });
});

The test fails before the final console.log during the setDoc call. The error is

Expected type 'Pa', but it was: a custom Fa object

I believe I traced this custom Fa object to the _delegate property on the firestore variable, but I am unclear of how to proceed from here.

  • I make sure that the emulators are all running before running npx cypress open
  • I tried setting the firestore property via the hub and get the same result
  • I have also tried passing a 'rules' property to firestore as a string

Any help would be greatly appreciated!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!