Skip to content

Commit

Permalink
feat: Add sample test code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryohidaka committed Sep 11, 2023
1 parent aec1f92 commit 515d102
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Greeter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Greeter } from "../src/Greeter";

describe("Greeter", () => {
it("should greet the person", () => {
const greeter = new Greeter();
const to = "John";

const consoleSpy = jest.spyOn(console, "log");
greeter.greet(to);

expect(consoleSpy).toHaveBeenCalledWith(`Hello ${to}`);

consoleSpy.mockRestore();
});
});

0 comments on commit 515d102

Please sign in to comment.