diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index 3d2de30b..71fd12e5 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -8,4 +8,9 @@ describe('amountToHangul', () => { expect(amountToHangul('100000000')).toEqual('일억'); expect(amountToHangul('100000100')).toEqual('일억백'); }); + + it('숫자로 된 금액이 80글자를 넘을 시 에러 발생', () => { + const longNumberString = '123456789012345678901234567890123456789012345678901234567890123456789012345678901'; + expect(() => amountToHangul(longNumberString)).toThrowError(`convert range exceeded : ${longNumberString}`); + }); });