Как я могу использовать результат «это» в тесте с ферментом? - PullRequest
0 голосов
/ 22 января 2019
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? В моем коде саги у меня есть:

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

    const pathUser = `users/${user.user.uid}`
...
yield database.ref(pathUser).update(newCadaster)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...