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.
npx cypress openAny help would be greatly appreciated!