From f50122409d89a4346181365c92b4c9f06bb00bbb Mon Sep 17 00:00:00 2001 From: kinndohyun Date: Tue, 25 Jun 2024 20:55:30 +0900 Subject: [PATCH 1/6] =?UTF-8?q?test:=20amountToHangul=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/amountToHangul.spec.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index 3d2de30b..fa06a50a 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -8,4 +8,10 @@ describe('amountToHangul', () => { expect(amountToHangul('100000000')).toEqual('일억'); expect(amountToHangul('100000100')).toEqual('일억백'); }); + + it('80자를 넘을 수 없다.', () => { + const testFn = () => + amountToHangul('123456789012345678901234567890123456789012345678901234567890123456789012345678901'); + expect(testFn).toThrowError(); + }); }); From 8f721446e2f9d97c4b62b729d354349410017c1b Mon Sep 17 00:00:00 2001 From: kinndohyun Date: Tue, 25 Jun 2024 21:06:14 +0900 Subject: [PATCH 2/6] =?UTF-8?q?test:=20amountToHangul=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/amountToHangul.spec.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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}`); }); }); From 3675cd11dd9139496383b90933a4ec8a2e98a651 Mon Sep 17 00:00:00 2001 From: kinndohyun Date: Tue, 25 Jun 2024 21:21:55 +0900 Subject: [PATCH 3/6] =?UTF-8?q?test:=20amountToHangul=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/amountToHangul.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index 71fd12e5..1b7430f4 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -11,6 +11,6 @@ describe('amountToHangul', () => { it('숫자로 된 금액이 80글자를 넘을 시 에러 발생', () => { const longNumberString = '123456789012345678901234567890123456789012345678901234567890123456789012345678901'; - expect(() => amountToHangul(longNumberString)).toThrowError(`convert range exceeded : ${longNumberString}`); + assert.throws(() => amountToHangul(longNumberString), Error, `convert range exceeded : ${longNumberString}`); }); }); From 4f7a721849ad00420fc0b6b8e8c742c2ea863299 Mon Sep 17 00:00:00 2001 From: kinndohyun Date: Fri, 28 Jun 2024 20:52:44 +0900 Subject: [PATCH 4/6] =?UTF-8?q?test:=20amountToHangul=20test=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/amountToHangul.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index 1b7430f4..bb3c6fd0 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -10,7 +10,7 @@ describe('amountToHangul', () => { }); it('숫자로 된 금액이 80글자를 넘을 시 에러 발생', () => { - const longNumberString = '123456789012345678901234567890123456789012345678901234567890123456789012345678901'; + const longNumberString = '1'.repeat(81); assert.throws(() => amountToHangul(longNumberString), Error, `convert range exceeded : ${longNumberString}`); }); }); From 5ba6490d7d60d03e24c13b63baba7cd91b5eb45b Mon Sep 17 00:00:00 2001 From: kinndohyun Date: Sun, 30 Jun 2024 13:28:54 +0900 Subject: [PATCH 5/6] =?UTF-8?q?fix:=20assert.throws=EB=8C=80=EC=8B=A0=20vi?= =?UTF-8?q?test=20toThrow=EB=A1=9C=20=EB=A9=94=EC=84=9C=EB=93=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/amountToHangul.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index bb3c6fd0..553586ab 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -11,6 +11,6 @@ describe('amountToHangul', () => { it('숫자로 된 금액이 80글자를 넘을 시 에러 발생', () => { const longNumberString = '1'.repeat(81); - assert.throws(() => amountToHangul(longNumberString), Error, `convert range exceeded : ${longNumberString}`); + expect(() => amountToHangul(longNumberString)).toThrow(`convert range exceeded : ${longNumberString}`); }); }); From 60bc00f061ce2f0c2942218d5facb239d8c22fb3 Mon Sep 17 00:00:00 2001 From: kinndohyun Date: Sun, 30 Jun 2024 17:44:47 +0900 Subject: [PATCH 6/6] =?UTF-8?q?fix:=20vitest=20toThrowError=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/amountToHangul.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amountToHangul.spec.ts b/src/amountToHangul.spec.ts index 553586ab..9fcb3bbc 100644 --- a/src/amountToHangul.spec.ts +++ b/src/amountToHangul.spec.ts @@ -11,6 +11,6 @@ describe('amountToHangul', () => { it('숫자로 된 금액이 80글자를 넘을 시 에러 발생', () => { const longNumberString = '1'.repeat(81); - expect(() => amountToHangul(longNumberString)).toThrow(`convert range exceeded : ${longNumberString}`); + expect(() => amountToHangul(longNumberString)).toThrowError(`convert range exceeded : ${longNumberString}`); }); });