skm*_*lin 6 javascript firebase-tools cypress google-cloud-firestore
我目前正在尝试在赛普拉斯中执行以下测试。
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);
});
});
Run Code Online (Sandbox Code Playgroud)
在 setDoc 调用期间,测试在最终 console.log 之前失败。错误是
Expected type 'Pa', but it was: a custom Fa object
Run Code Online (Sandbox Code Playgroud)
我相信我将此自定义 Fa 对象跟踪到了 firestore 变量上的 _delegate 属性,但我不清楚如何从这里继续。
npx cypress open任何帮助将不胜感激!
| 归档时间: |
|
| 查看次数: |
424 次 |
| 最近记录: |