In the following code, Will beforeEach() function execute also before each inner describe or it will only execute before each it() block?

describe('outer describe',()=>{

beforeEach(() => {
});

describe('inner describe1',()=>{
});

describe('inner describe2',()=>{
 });

it('First It1',()=>{
});

it('Second It2',()=>{
});

});

1 Answers

0
Giovani Vercauteren On

It will only be executed before each it() call. You can still put an it() call inside the inner describe() and it will still make use of the beforeEach() in the outer describe.