💾K
Size: a a a
💾K
💾K
describe('should start', () => {пишет Cannot read property 'status' of undefined
it('Check checkStatus', (done) => {
beforeEach(() => {
window.history.pushState({}, 'Page Title', '/');
});
const store = doLogout({});
store.dispatch(checkStatus()).then(() => {
const actions = store.getActions();
expect(actions[0]).toEqual({
type: DO_LOGOUT
});
const history = {push: jest.fn()};
expect(history.push).toHaveBeenLastCalledWith(createInternationalUrl(frontendUrls.urlOnlyInUSA));
done();
}).catch((err) => {
console.log(err);
done();
});
})
})
SA
💾K
it('should do something async', () => {
expect.assertions()
return checkStatus()
.then(result => {
expect(response.status.data).toEqual('xyz')
expect(response.errors).toBeNull()
})
})
I
AV
I
R(
I
R(
I
V
V
ИС
V
V
ИС
V
V
ИС
([^"]+)
.