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