0

I've multiple tests that I'd like to group together.

I'm currently using require to group them under a common describe ancestor:

// all tests
describe('Some feature',() => {
  require('some_use_case');
  require('another_use_case');
});

describe('Another feature',() => {
  require('yet_another_use_case');
});

// and then in some_use_case.ts
describe('Some use case',() => {
  it('should do something');
});

which correctly groups the tests as I want:

Some Feature
  Some Use case:
    should do something.
  Another Use Case: 
    ...

The issue is the paths in require have to be kept in sync when modifying a file name and the IDE doesn't do it by itself.

Note: I'm just wondering if there is a simple way of achieving this. I do not want to play with custom formatters etc.

Ced
  • 15,847
  • 14
  • 87
  • 146

0 Answers0