neet/refined-itsukara-link

View on GitHub
packages/@neet/vschedule-api/src/domain/entities/channel/channel-description.spec.ts

Summary

Maintainability
A
3 hrs
Test Coverage
import {
  ChannelDescription,
  ChannelDescriptionLengthError,
} from './channel-description';

describe('ChannelDescription', () => {
  it('constructs', () => {
    const description = new ChannelDescription('hello');
    expect(description.value).toBe('hello');
  });

  it('throws and error when description is too long', () => {
    expect(() => {
      new ChannelDescription('a'.repeat(5001));
    }).toThrowError(ChannelDescriptionLengthError);
  });
});