cegonse/cest

Support after and before all test-suite level setup and teardown

cegonse opened this issue · 0 comments

Support of afterAll() and beforeAll() expressions which must be executed only once before and after all tests in the suite have been executed.

describe("some repository", []() {
    Repository repository;

    beforeAll([&]() {
        repository.create();
    });

    afterAll([&]() {
        repository.destroy();
    );

    beforeEach([&]() {
        repository.insert(Item(123));
    });

    afterEach([&]() {
        repository.remove(123);
    });

    it("contains an item with ID 123", [&]() {
        expect(repository.contains(123)).toBeTruthy();
    });
});