I'm encountering a situation when I use the beforeEach
async and I have a couple of tests in my spec.
I see that the beforeEach
is getting called for each test that runs instead of only once before all the tests - what am I doing wrong?
Here's my code:
describe("desc1", function () {
beforeEach((done) => {
// some logic
done();
});
}
describe("desc2",() => {
it("has a value", () => {
expect().toBe('');
});
it("has a value", () => {
expect().toBe('');
});
it("has a value", () => {
expect().toBe('');
});
});
});
});
I'm using Typescript as you can see and Chutzpa