Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
テストケースを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
takahash committed Nov 7, 2023
1 parent a96fc94 commit a8bc2cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions __tests__/basic/script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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("条件分岐・データ型の問題", () => {
Expand All @@ -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"));
});

0 comments on commit a8bc2cf

Please sign in to comment.