UNPKG

@dxdeveloperexperience/hygie

Version:

Hygie is an easy-to-use Open-Source REST API allowing you to interact with GIT events. This NestJS API expose a set of customizable rules to automate your project's life cycle.

33 lines (29 loc) 1.01 kB
import { SchedulerException } from './scheduler.exception'; import { FileSizeException } from './fileSize.exception'; import { CronExpressionException } from './cronExpression.exception'; describe('Exceptions', () => { describe('Scheduler Exception', () => { it('should throw an error message', () => { const myFunction = () => { throw new SchedulerException('My exception'); }; expect(myFunction).toThrow('My exception'); }); }); describe('File Size Exception', () => { it('should throw an error message', () => { const myFunction = () => { throw new FileSizeException('some/file.ext'); }; expect(myFunction).toThrow('some/file.ext too big!'); }); }); describe('Cron Expression Exception', () => { it('should throw an error message', () => { const myFunction = () => { throw new CronExpressionException('Some error message'); }; expect(myFunction).toThrow('Some error message'); }); }); });