问题描述
我正在尝试按照 firebase 文档来测试安全规则 (Build unit tests),特别是 video。
但是错误不允许我继续...this。
我的模拟器没问题...但是任何东西都不起作用,因为在激活模拟器后,我遇到了和以前一样的错误。 (...客户端离线)
有人可以帮我吗?
测试代码与视频中相同(我已将项目ID更改为'xxxxxxxxxxxxxx'以保密):
const assert = require('assert')
const firebase = require('@firebase/testing')
const MY_PROJECT_ID = 'xxxxxxxxxxxxxx'
describe('Our social app',() => {
it('Understands basic addition',() => {
assert.strictEqual(2 + 2,4)
})
it('Can read items in the read-only collection',async () => {
const db = firebase.initializeTestApp({ projectId: MY_PROJECT_ID }).firestore()
const testDoc = db.collection('readonly').doc('testDoc')
await firebase.assertSucceeds(testDoc.get())
})
})
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)