我如何在酶测试中使用'it'的结果?

时间:2019-01-22 01:23:03

标签: javascript firebase jestjs enzyme redux-saga

it('should call api createUserWithEmailAndPassword', result => {
    expect(result).toEqual(call([authMock, createUserWithEmailAndPassword], actionMock.user.email, actionMock.user.passwd))
    return {
         user: {
             user: {
                 uid: undefined
             }
         }
    }       
})
const pathUser = `users/`+{user:{user:{uid:undefined}}} //i need to take a result of 'should call api createUserWithEmailAndPassword' to use here

如何将user.user.uid放入pathUser中? 在我的代码sagas中,我有:

const user = yield call([auth, createUserWithEmailAndPassword], email, passwd)

    const pathUser = `users/${user.user.uid}`
...
yield database.ref(pathUser).update(newCadaster)

0 个答案:

没有答案