From a8bc2cfa1a67109618abafc88e3177c29f915cab Mon Sep 17 00:00:00 2001 From: Ken Takahashi Date: Tue, 7 Nov 2023 14:08:57 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=B1=E3=83=BC?= =?UTF-8?q?=E3=82=B9=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __tests__/basic/script.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/__tests__/basic/script.test.ts b/__tests__/basic/script.test.ts index 1b1d6f2..287f13e 100644 --- a/__tests__/basic/script.test.ts +++ b/__tests__/basic/script.test.ts @@ -4,7 +4,9 @@ import { func1, func2 } from "../../basic/script"; describe("ループ・配列の問題", () => { test("func1", () => expect(func1(5)).toEqual([1, 2, 3, 4, 5])); test("func1", () => expect(func1(8)).toEqual([1, 2, 3, 4, 5, 6, 7, 8])); + test("func1", () => expect(func1(0)).toEqual([])); test("func1", () => expect(func1(-1)).toEqual([])); + test("func1", () => expect(func1("hogehoge")).toEqual([])); }); describe("条件分岐・データ型の問題", () => { @@ -14,5 +16,7 @@ describe("条件分岐・データ型の問題", () => { test("func2", () => expect(func2(15)).toEqual("FizzBuzz")); test("func2", () => expect(func2(22)).toEqual("22")); test("func2", () => expect(func2(30)).toEqual("FizzBuzz")); + test("func2", () => expect(func2(0)).toEqual("error")); + test("func2", () => expect(func2(-1)).toEqual("error")); test("func2", () => expect(func2("hogehoge")).toEqual("error")); });