GlaceJS concepts

test - test case. Wrapper on mochajs describe. Should have readable and unique name per suite.

test("my test", () => {
    chunk(() => {
        // payload
    });
});

chunk - a set of actions in test. Wrapper on mochajs it. Test should contain as minimum one chunk. Chunks are executed independently inside a test. Chunk may have name or be anonymous.

/* anonymous chunk */
test("my test", () => {
    chunk(() => {
        // payload
    });
});

/* named chunks */
test("my test", () => {
    chunk("#1", () => {
        // payload
    });
    chunk("#2", () => {
        // payload
    });
});

scope - the scope of tests or chunks, which is used for grouping. Wrapper on mochajs describe. If you have more than one file with tests, it will be a good style to wrap all tests inside file under one scope for visual grouping in stdout report.

/* scope of tests */
scope("Auth", () => {
    test("is passed", () => {
        // test case
    });
    test("is failed", () => {
        // test case
    });
});

/* scope of chunks */
test("Auth", () => {
    scope("is passed", () => {
        chunk("for user", () => {
            // payload
        });
        chunk("for admin", () => {
            // payload
        });
    });
});

before - mochajs before.

after - mochajs after.

beforeChunk - wrapper on mochajs beforeEach.

afterChunk - wrapper on mochajs afterEach.