I want to write tests for promise result and I dot'n want to resolve promise in each it/pit
section.
I need smth like this:
describe('getData() results test', () => {
return getData().then(response => {
it('foo', () => expect(response.foo).toEqual(1));
it('bar', () => expect(response.bar).toEqual(2));
it('bar', () => expect(response.bar).toEqual(3));
});
});
If use beforeEach
- promise will be resolved as many times as number of it
sections. I need to resolve it once and then test response. There are a lot of test cases so I want to split all tests into it
sections