Вы должны хорошо использовать метод Моха describe
для логической группировки ваших тестов. Для желаемого результата структура ваших тестов будет выглядеть следующим образом:
/ test / testFoo. js
describe('testFoo', () => {
describe('Doing X', () => {
it('should return A', () => {
});
it('even with negative input', () => {
});
});
describe('Doing Y', () => {
it('should return B', () => {
});
it('should return C when called with Egyptian hieroglyphs', () => {
});
});
});
/ test / testBar. js
describe('testBar', () => {
describe('Doing Z', () => {
it('should return D', () => {
});
});
});