Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 453 Bytes

naming.md

File metadata and controls

31 lines (24 loc) · 453 Bytes

The name of the test should reveal its intention

When a test fails, its name is the first indication of what may have gone wrong.

Bad:

describe('Calendar', () => {
  it('2/29/2020', () => {
    // ...
  });

  it('throws', () => {
    // ...
  });
});

Good:

describe('Calendar', () => {
  it('should handle leap year', () => {
    // ...
  });

  it('should throw when format is invalid', () => {
    // ...
  });
});